package com.itheima.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.entity.PageResult;
import com.itheima.entity.Result;
import com.itheima.service.SetmealService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class SetmealController {

    @Reference
    private SetmealService setmealService;

    // /setmeal/getSetmeal
    //查看所有的套餐
    @RequestMapping("/setmeal/getSetmeal")
    public Result getSetmeal(){
        return setmealService.getSetmeal();
    }

    // /setmeal/findById
    //查看某一个套餐的详情

    @RequestMapping("/setmeal/findById")
    public Result findById(Integer id){
        return setmealService.findById(id);
    }

    // 新增 分页查询
    @RequestMapping("/setmeal/getPageSetmeal")
    public PageResult getPageSetmeal(Integer start,Integer pageSize){
        return setmealService.getPageSetmeal(start,pageSize);
    }

}
